package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/member/orders/project")
public class ProjectMemberController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;

    @GetMapping("/page")
    public TableDataInfo findProjectList(NursingProject nursingProject){
        List<NursingProject> projectList =  nursingProjectService.findProjectList(nursingProject);
        return getDataTable(projectList);
    }

    @GetMapping("/{id}")
    public AjaxResult selectProjectList(@PathVariable("id") Long id){
        return success(nursingProjectService.selectProjectById(id));
    }
}